<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>My JSP 'register.jsp' starting page</title>
<style type="text/css">
.hahaha {
	width: 100%;
	height: 100%;
	position: absolute;
}

.image {
	background: url(<%=request.getContextPath()%>/img/register.jpg)
		no-repeat center;
	background-size: cover;
	height: 80%;
	display: flex;
	justify-content: center;
	align-content: center;
	z-index: 99;
}

body {
	padding: 0;
	margin: 0;
}

.juxing {
	/* width: 45%; */
	height: 80%;
	display: flex;
	justify-content: center;
	/* background-color: black; */
	/* margin-left: 50% */;
	/* padding: 5% 0; */
	margin-top: 38.5px;
	display: flex;
	flex-direction: column;
}

.ooo {
	z-index: 999;
}

.ooo img {
	width: 396px;
	/* height: 228px; */
}

.huafang {
	background-image: url(<%=request.getContextPath()%>/img/logo.png);
	background-size: cover;
	width: 320px;
	height: 152px;
}

.container {
	height: 10%;
	/* position: absolute; */
	margin-bottom: 28px;
}

.container img {
	width: 210px;
	height: 100px;
	margin-left: 5%;
}

.content {
	/* width: 480px; */
	height: 500px;
	/* background-color: red; */
	display: flex;
	flex-direction: column;
	justify-content: center;
	margin-top: -15px;
}

.banyuan {
	display: inline-block;
	width: 36px;
	height: 50px;
	background: red;
	border-radius: 25px 0px 0 25px;
	background-color: rgba(209, 236, 239, 0.8);
	/* opacity: 0.5; */
}

.form-control {
	width: 320px;
	height: 50px;
	border-radius: 0px 25px 25px 0px;
	border: 0;
	padding: 0 20px;
	background-color: rgba(209, 236, 239, 0.2);
	/* opacity: 0.5; */
	outline: none;
	color: #000000;
	border-color: #ffffff;
	z-index: 999;
}

.lalala {
	height: 16px;
	display: flex;
	margin-top: 40px;
	z-index: 999;
}

.chulai {
	z-index: 999;
}

.aaa {
	width: 120px;
	height: 30px;
	background-color: #ceefec;
	border: 0;
	border-radius: 24.2px;
	margin-top: 100px;
}

.chabuduo {
	z-index: 999;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}

.chabuduo span a {
	color: #ffffff;
	font-size: 12px;
	text-decoration: none;
}

.www {
	z-index: 999;
}

.foot ul {
	display: flex;
	justify-content: center;
}

.foot ul li {
	display: inline-block;
	padding: 0 20px;
	color: #666;
	font-size: 12px;
	margin-bottom: 10px;
}

.mgj_footer_hostname {
	margin-top: 20px;
	color: hsla(0, 0%, 40%, .7);
	display: flex;
	justify-content: center;
	margin-bottom: 10px;
	font-size: 13px;
}
</style>

<script type="text/javascript">
	window.onload = function() {
		var username = document.getElementById("username");
		var pwd1 = document.getElementById("pwd1");
		var pwd2 = document.getElementById("pwd2");
		var phone = document.getElementById("phone");
		var btn = document.getElementById("btn");
		//光标进入焦点事件
		username.onfocus = function() {
			if (username.value == "请输入一个用户明名") {
				username.value = "";
				this.style.color = "#000";
				this.style.fontSize = "16px";
			}
		};

		//光标失去焦点事件
		username.onblur = function() {
			if (username.value == "") {
				username.value = "请输入一个用户明名";
				this.style.color = "#999";
				this.style.fontSize = "12px";
				var reg = /^[a-zA-Z][a-zA-Z0-9]\w{4,14}$/; //正则表达式匹配字母开头,字母数字下划线组合,6-18位
			}
		};

		pwd1.onfocus = function() {
			if (pwd1.value == "请输入密码") {
				pwd1.value = "";
				this.style.color = "#000";
				this.setAttribute("type", "password");
				this.style.fontSize = "16px";
			}
		};

		pwd1.onblur = function() {
			if (pwd1.value == "") {
				pwd1.value = "请输入密码";
				this.style.color = "#999";
				this.setAttribute("type", "text");
				this.style.fontSize = "12px";
			}
		};

		pwd2.onfocus = function() {
			if (pwd2.value == "确认密码") {
				pwd2.value = "";
				this.style.color = "#000";
				this.setAttribute("type", "password");
				this.style.fontSize = "16px";
			}
		};

		pwd2.onblur = function() {
			if (pwd2.value == "") {
				pwd2.value = "确认密码";
				this.style.color = "#999";
				this.setAttribute("type", "text");
				this.style.fontSize = "12px";
			}
		};

		phone.onfocus = function() {
			if (phone.value == "请输入手机号") {
				phone.value = "";
				this.style.color = "#000";
				this.style.fontSize = "16px";
			}
		};

		phone.onblur = function() {
			if (phone.value == "") {
				phone.value = "请输入手机号";
				this.style.color = "#999";
				this.style.fontSize = "12px";
				var reg = /^1[3|4|5|7|8][0-9]\d{8}/; //正则表达式匹配手机号
			}
		};

	

		btn.onclick = function() {
			if (username.value == "请输入一个用户明名" || username.value == "") {
				alert("请输入用户名");
			} else {
				if (pwd1.value == "请输入密码" || pwd1.value == "") {
					alert("请输入密码");
				} else {
					if (pwd1.value != pwd2.value) {
						alert("两次密码不一致");
					} else {
						if (phone.value == "请输入手机号" || phone.value == "") {
							alert("请输入手机号");
						} else {
								var form = document.getElementById("form");
								form.submit();
							}
						}
					}
				}
			}
		};
	
</script>





</head>
<body>
	<div class="hahaha">

		<div class="container">
			<div class="www">
				<img src="<%=request.getContextPath()%>/img/logo.png"><font
					size="6" face="黑体">欢迎注册</font>
			</div>


		</div>

		<div class="image">
			<div class="juxing">

				<form action="<%=request.getContextPath()%>/user/register"
					method="post" id="form">
					<div class="content">
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								name="username" id="username" placeholder="请输入用户名"></span>
						</div>
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								name="password"  type="password"  placeholder="请输入密码" id="pwd1"></span>
							<input type="hidden" 	name="status"   value="1">
						</div>
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								placeholder="确认密码" type="password" id="pwd2"></span>
						</div>
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								name="nickname"    placeholder="请输入昵称" id="nickname"></span>
						</div>
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								type="date" placeholder="请选择生日" name="birth" id="birth"></span>
						</div>
						<div class="lalala">
							<span class="banyuan"></span> <input class="form-control"
								type="text" name="phone" placeholder="请输入手机号" id="phone"></span>
						</div>
						<div class="chulai" align="center">
							<input class="aaa" type="button" id="btn"  value="注册" />
							 <input
								class="aaa" type="reset" id="res" value="重置" />
			</div>
		</div>
			</form>
	</div>
</div>
	<div>
</div>	
	
		<div class="foot">
			<div>
				<ul>
					<li>关于我们</li>
					<li>|</li>
					<li>联系我们</li>
					<li>|</li>
					<li>管理员入口</li>
					<li>意见反馈</li>
					<li>|</li>
					<li>规则中心</li>
					<li>|</li>
					<li>基本信息</li>
					<li>|</li>
					<li>特色产品</li>
				</ul>
			</div>

			<div class="mgj_footer_hostname">
				<span>————————————————————————————————————————&ensp;&ensp;&ensp;&ensp;©2019
					dqz.com
					大民主&ensp;&ensp;&ensp;&ensp;————————————————————————————————————————</span>
			</div>
		</div>
	</div>
	<script type="text/javascript">

		</script>
</body>
</html>
